﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteWithControlAccess.Master"
    Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="ProjetoComperio.Framework.Web.Security.UrlEncrypt" %>
<%@ Import Namespace="ProjetoComperio.DataLayer.Entities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Aplicações de TI na Educação</h2>
    <div align="right">
        <%= Html.ActionLink("Novo","Create","EducationalITApplication") %>
    </div>
    <div class="Grid">
        <%= Html.Grid(ViewData["GridSource"] as IQueryable<EducationalITApplication>).Columns(column =>
{           
     		column.For(x => x.Title).Named("Titulo");
     		column.For(x => x.IsOpenSource).Named("É OpenSource");
     		column.For(x => x.IsFree).Named("É Livre");
            column.For(x => x.RegisterDate.ToString("dd/MM/yyyy")).Named("Data de cadastro");
            column.For(x => Html.ActionLink("Editar", "Edit", new { id = URLEncrypt.EncryptToString(x.ContributionID.ToString()) })
            ).DoNotEncode().Attributes(x => new Hash(style => "font-weight:bold")).CellCondition(x => x.IsActive == true);

            column.For(x => x.IsActive).Named("Ativa?");

        }).Attributes(style => "width:100%")
          .Empty("Não existem aplicações cadastradas.")
    
        %>
    </div>
    <br />
    <br />
</asp:Content>
